package com.example.service.member.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.domain.member.Member;
import com.example.entity.service.member.getMemberWithName.MemberWithName;
import com.example.service.member.mapper.MemberMapper;
import com.example.service.member.service.IMemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements IMemberService {

    @Autowired
    private MemberMapper memberMapper;

    //member模块依赖了user模块，user模块同时依赖了member，这样的循环依赖是不允许的
//    @Autowired
//    private IUserService userService;

    @Override
    public List<Member> selectMemberByName(String name) {
        return memberMapper.selectMemberByName(name);
    }

    @Override
    public MemberWithName getMemberWithName() {
        MemberWithName memberUser = new MemberWithName();
        memberUser.setMember(new Member());
        memberUser.setName("xw.s");
        return memberUser;
    }

}
